<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class home extends CI_Controller {
    public function index()
    {
    	$this->load->model('user_model', null, true);	          		
		//-------------Weather at--------------------
		$weather = $this->user_model->getAllWeather();
		$arrayXmlSinWeather = $weather[0]->content;
		$arrayXmlNzlWeather = $weather[1]->content;
		$arrayXmlHCMWeather = $weather[2]->content;
	
		
		$autNew = $this->user_model->getAllAutNew();
		$autLibrary = $this->user_model->getAllAutLibrary();
		$query = $this->db->query('SELECT * FROM photo');
		$photoArray=array();
		$photoArray=$query->result_array();	
    
		//-----------------
		$arrayFile = array();
    	$data = array();
    	$data['controller']='';
    	$data['name_view']='home';
    	//$data['arrayXml']=$arrayXml;
    	$data['arrayXmlSinWeather']=$arrayXmlSinWeather;
    	$data['arrayXmlHCMWeather']=$arrayXmlHCMWeather;
    	$data['arrayXmlNzlWeather']=$arrayXmlNzlWeather;
    	$data['arrayXmlAUTnews']=$autNew;
    	$data['arrayXmlAUTLinews']=$autLibrary;
    	
    	$data['photoArray']=$photoArray;
        $this->load->view('template',$data);
    }
}